﻿using Modules.FaceScan;
using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.FaceScan.Entitys
{
    /// <summary>
    /// 人员身份证及比对照片
    ///</summary>
    [TableName("person_face")]
    [Description("人员比对照片表")]
    [PrimaryKey("id", AutoIncrement = false)]
    [CacheSetting(true)]
    [Serializable]
    public class FacePhoto : IEntity
    {
        /// <summary>
        ///
        ///</summary>
        [Column("id")]
        public string Id { get; set; }

        /// <summary>
        /// 照片类型
        ///</summary>
        [Column("photo_type")]
        public PhotoType PhotoType { get; set; }

        /// <summary>
        /// 身份证
        ///</summary>
        [Column("id_card")]
        public string IdCard { get; set; }

        /// <summary>
        /// 身份证证照
        ///</summary>
        [Column("id_card_photo")]
        public string IdCardPhoto { get; set; }

        /// <summary>
        /// 身份证照片版本号
        ///</summary>
        [Column("id_card_photover")]
        public int IdCardPhotover { get; set; }

        /// <summary>
        /// 身份证照片更新时间
        ///</summary>
        [Column("id_card_photo_time")]
        public DateTime IdCardPhotoTime { get; set; }

        /// <summary>
        /// 验证照片
        ///</summary>
        [Column("verify_photo")]
        public string VerifyPhoto { get; set; }

        /// <summary>
        /// 核验照片版本号
        ///</summary>
        [Column("verify_photover")]
        public int? VerifyPhotover { get; set; }

        /// <summary>
        /// 验证照片更新时间
        ///</summary>
        [Column("verify_photo_time")]
        public DateTime? VerifyPhotoTime { get; set; }

        /// <summary>
        /// 创建时间
        ///</summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        ///  真实性评级
        ///</summary>
        [Column("real_level")]
        public FacePhotoRealLevel RealLevel { get; set; } = FacePhotoRealLevel.Medium;

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return Id; } }

        #endregion IEntity 成员
    }
}